#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
char* my_strcpy(char* dest, const char* src,size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (*src != '\0'&&num!=0)
	{
		*dest = *src;
		dest++;
		src++;
		num--;
	}
		*dest = '\0';
	return ret;
}
int main()
{
	char arr1[] = "abcdef";
	char arr2[20];
	size_t n = 5;
	my_strcpy(arr2, arr1,5);
	printf("%s\n", arr1);
	printf("%s\n", arr2);
	return 0;
}